﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace no._4
{
    
    public class rectangle
    {
        public double length;
        public double width;

        public bool islegal(int length,int width)
        {
            if (length > 0 && width > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        public double squarenum(int length, int width)
        {
            return length * width;
        }
    }

    public class square
    {
        public double length;

        public bool islegal(int length)
        {
            if (length > 0 )
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        public double squarenum(int length)
        {
            return length * length;
        }
    }

    public class triangle
    {
        public double a;
        public double b;
        public double c;

        public bool islegal(int a, int b,int c)
        {
            if (a > 0 && b > 0&& c>0 && (a+b>c) && (b+c>a) && (a+c>b))
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        public double squarenum(int a, int b,int c)
        {
            int p = (a + b + c) / 2;
            int s = p * (p - a) * (p - b) * (p - c);
            return Math.Sqrt(s);
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
        }
    }
}
